FIX: Adds register method#5
Open
sauravsrijan wants to merge 2 commits intosanketsaurav:masterfrom
sauravsrijan:register
Open
FIX: Adds register method#5sauravsrijan wants to merge 2 commits intosanketsaurav:masterfrom sauravsrijan:register
sauravsrijan wants to merge 2 commits intosanketsaurav:masterfrom
sauravsrijan:register
Conversation
registers new icons, updates README, adds tests and a test svg icon.
sanketsaurav
requested changes
Dec 11, 2018
|
|
||
| # Register method for a new icon. | ||
| @classmethod | ||
| def register(cls, symbol, svg_file): |
Owner
There was a problem hiding this comment.
Add a docstring for this method, which should explain what this method does and how it should be used. This is important since it's a public method.
| doc = minidom.parse(svg_file) | ||
| path_strings = [path.getAttribute('d') for path | ||
| in doc.getElementsByTagName('path')] | ||
| path = '<path fill-rule="evenodd" d="'+path_strings[0]+'"'+"/>" |
Owner
There was a problem hiding this comment.
Please add comments for all these magic literals.
| path = '<path fill-rule="evenodd" d="'+path_strings[0]+'"'+"/>" | ||
|
|
||
| values = { | ||
| 'name': symbol, |
Owner
There was a problem hiding this comment.
Indent the key-value pairs one level.
| } | ||
|
|
||
| OCTICON_DATA.update({symbol:values}) | ||
| doc.unlink() |
Owner
There was a problem hiding this comment.
Why is this needed? Please add a comment.
| 'path': path | ||
| } | ||
|
|
||
| OCTICON_DATA.update({symbol:values}) |
Owner
There was a problem hiding this comment.
This function should return True if the registration is successful.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
registers new icons, updates README, adds tests and a test svg icon.